#include<iostream>
using namespace std;
#include"list.h"

int main()
{
	bit::list<int>l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_back(5);

	for (auto it : l1)
	{
		cout << it << " ";
	}
	cout << endl;

	bit::list<int>l2(l1);
	for (auto it : l2)
	{
		cout << it << " ";
	}

	bit::list<int>l3 = l1;
	cout << endl;
	for (auto it : l3)
	{
		cout << it << " ";
	}

	cout << endl;

	cout << l1.back();
	cout << endl;

	cout << l1.front();
	cout << endl;

	if (!l1.empty())
	{
		cout << "not empty!" << endl;
	}

	bit::list<int>::iterator it = l1.begin();

	++it;

	l1.insert(it, 666);
	for (auto it : l1)
	{
		cout << it << " ";
	}

	cout << endl;
	bit::list<int>::reverse_iterator IT = l1.rbegin();

	for (bit::list<int>::reverse_iterator rit = l1.rbegin(); rit != l1.rend(); ++rit) {
		std::cout << *rit << " ";
	}

	return 0;
}